home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 25
/
Cream of the Crop 25.iso
/
os2
/
vac23.zip
/
adeptrexxchatfuncs.doc
< prev
next >
Wrap
Text File
|
1997-02-20
|
18KB
|
581 lines
AdeptXBBS REXX INTERFACE
Adept v1.08x Chat Routines
Copyright (c) 1993 - 1996 by AdeptSoft
portions Copyright (c) 1991-1994 M. Kimes
All Rights Reserved
AdeptSoft, AdeptXBBS, GateKeeper,
are trademarks of AdeptSoft.
"XBBS" Copyright (c) 1988 - 1994 by M. Kimes. The "XBBS" name is a
Trademark of M. Kimes.
The IRC_* constants are (Note: You MUST call AdeptInitREXX first):
LOSTCARRIER if the carrier had been dropped.
IRC_NOTIMELEFT if no time is remaining.
IRC_LOCKEDOUT if the sysop locked the user out.
IRC_MORON if the system hit the moron key.
IRC_REPROMPT to request a redraw of the prompt or screen.
IRC_ENDSYSOPCHAT if the sysop broke into chat and just ended it.
IRC_IDLETIMEOUT if the user idle's out
IRC_CHATWAITING if a chat message is waiting to be processed.
IRC_CHATDOWN if the chat server went down.
Additional Metas:
{PQ Displays press any key to continue if the displayed amount of lines is
more then the users screen length.
{DA Who the message was to
{DB The Message Subject
{DC Area name message was posted to
{DD Node number of receipient
{DE Area number the message was posted to
{ZZ Do not translate any metas from here until the end of the string.
FUNCTION LISTING
---------------------------------------------------------------------------
AdeptSysChatConnectUser()
FUNCTION USAGE
value = AdeptSysChatConnectUser(LineNumber)
ARGUMENTS
LineNumber:
Node Number passed to REXX routine from Adept as first parameter.
RETURNED VALUE
0 - Syntax error
1 - User connected with server
2 - Failed to connect user to server
3 - Server unavailable
DESCRIPTION
Will connect/sign up a user with the chat server.
NOTES
EXAMPLE
The next example will attempt to connect the user to the chatserver,
if it succeeds it will join the user to the main conference. If not,
the script will notify the user that the server is down and exit the
script.
RetC = AdeptSysChatConnectUser(line)
if(RetC == 1) then do
RetC = AdeptSysChatJoinConf(line, "Main")
end
else do
AdeptPrint(line, "\r\n\nChat server unavailable\r\n{PC")
exit
end
RELATED FUNCTIONS
AdeptSysChatReconnectUser()
AdeptSysChatUserConnected()
---------------------------------------------------------------------------
AdeptSysChatCustomMsg()
FUNCTION USAGE
call AdeptSysChatCustomMsg LineNumber, PktType, To, Message
or
value = AdeptSysChatCustomMsg(LineNumber, PktType, To, Message)
ARGUMENTS
LineNumber:
Node Number passed to REXX routine from Adept as first parameter.
PktType:
Packet Type. Must be greater than 1000.
To:
User Name to send custom message to.
or
-1 - All users in the current channel
-2 - All users on the BBS (Not currently supported)
-3 - All users on the chatserver (Not currently supported)
-4 - All local ops (Not currently supported)
-5 - All server ops (Not currently supported)
Message:
Message to send.
RETURNED VALUE
0 - Syntax error
1 - Sent to server
DESCRIPTION
AdeptSysChatCustomMsg allows you to send messages to the user that
you can parse via the rexx AdeptSysChatGetMsg. This allows you to
add new chat options, functions and types.
NOTES
You cannot specify a type below 1000, all types MUST begin with
1001 or higher, the bottom 1000 are reseved for system use.
You can have fun with this.
EXAMPLE
This example will alert everyone in the channel that the user has
left the channel and exit the user from the channel.
Leave:
Parse Arg Reason
rc = AdeptSysChatPubMsg(Line, '{FG« {FF' || UserName || ' has Left the Channel!')
rc = AdeptSysChatCustomMsg(Line, 1002, -1, 'Leave')
rc = AdeptSysChatLeaveConf(Line)
Return
RELATED FUNCTIONS
AdeptSysChatGetMsg()
---------------------------------------------------------------------------
AdeptSysChatGetMsg()
FUNCTION USAGE
value = AdeptSysChatGetMsg(LineNumber)
ARGUMENTS
LineNumber:
Node Number passed to REXX routine from Adept as first parameter.
RETURNED VALUE
0 - Didn't receive a packet or bad packet
1 - Received a chat packet that does NOT have a chatmsg attached
2 - Received a chat packet that does have a chatmsg attached
3 - Received a chat packet that does have a chatmsg with a chat
data packet attached.
DESCRIPTION
You call this when you receive a IRC_CHATWAITING. It will return a
value according to the table above and may assign values to a number
of variables (detailed below)
NOTES
The variables are:
The following are set if the return code is 1
PKTTYPE - Packet type definitions follow.
100 - Standard Public Conference Message
101 - No Prepended Public Conference Message
102 - Private message to another user/node
103 - Invite a user to a channel
104 - Leave chat
105 - System Global Message to all no matter where
PKTSERIAL - Packet Serial Number (Currently the time it was sent)
PKTCRC - 32 bit CRC of the ChatMsg if one it to be sent for
validation of the chat message.
The following are also set if the return code is 2
CHATMSGFROM - User or Node number the chat message was from.
CHATMSGFLAGS - Flags for the message (Currently unused)
CHATMSGSCRAMBLE - Scramble code for the message, I.E. Only those
with the same code set can see it.
CHATMSGTO - Who the message is to. If blank, it's considered
to be a public style message for use public chat.
The following are also set if the return code is 3
CHATMSGDATALEN - Length of the data.
CHATMSGDATACRC - CRC of the Data.
CHATMSGDATA - The data, usually the chat messages text, could
be binary if you so desire. 4k limit.
EXAMPLE
if(AdeptSysChatMsgWaiting(line) == 1)then
do
RetC = AdeptSysChatGetMsg(line)
if(RetC == 2) then do
if(PktType == 103) then do
AdeptPrint(line, "\rUser "||CHATMSGFROM||" invited you to chat!\r\n")
return 0
end
end
end
RELATED FUNCTIONS
AdeptSysChatCustomMsg()
---------------------------------------------------------------------------
AdeptSysChatInput()
FUNCTION USAGE
call AdeptSysChatInput LineNumber, "BufferName", AbortKeyList,
InputText
or
value = AdeptSysChatInput(LineNumber, "BufferName", AbortKeyList,
InputText)
ARGUMENTS
LineNumber:
Node Number passed to REXX routine from Adept as first parameter.
BufferName:
Variable to place the text in.
AbortKeyList:
AbortKeyList is a optional command. If you don't pass it a keylist
and the user presses enter on a line it will return 1, if you pass
it a keylist and the user presses enter it will return 1, for all
other keys pressed it will return their ascii value.
The keylist should not contain the ascii numeric value for a key
but the actual ascii key itself. (ie. Ascii 3, ^C would be a heart.)
InputText:
If InputText is passed it will place it in the users buffer as if they
had typed it. They can backspace over it and delete the text passed
to the buffer.
RETURNED VALUE
The above function will return 1 if all is well and the user pressed
return. It can also return any of the IRC_* constants.
DESCRIPTION
A function very similiar to AdeptInput except specificly designed to
be used with multi-node chat.
NOTES
AbortKeyList and InputText are optional, you don't need to pass them
for AdeptSysChatInput to work.
EXAMPLE
This example will input a chat line from the user into UserText to be
parsed and output appropriatly later.
RetC = AdeptSysChatInput(line, "USERTEXT", KeyList)
RELATED FUNCTIONS
---------------------------------------------------------------------------
AdeptSysChatJoinConf()
FUNCTION USAGE
call AdeptSysChatJoinConf LineNumber, ConferenceName
or
value = AdeptSysChatJoinConf(LineNumber, ConferenceName)
ARGUMENTS
LineNumber:
Node Number passed to REXX routine from Adept as first parameter.
ConferenceName:
Name of conference to join user to.
RETURNED VALUE
0 - Join Not Successful
1 - Access Denied to Channel
2 - Channel Joined
DESCRIPTION
Joins the user to a chat conference.
NOTES
EXAMPLE
This example will attempt to join the user to a conference named Main.
It will exit the script if the attempt was unsuccessful.
rc = AdeptSysChatJoinConf(line, "Main")
if(rc<>2)then
do
Call AdeptPrint line, "I'm sorry. Could not join conference!"
exit
end
RELATED FUNCTIONS
AdeptSysChatLeaveConf()
---------------------------------------------------------------------------
AdeptSysChatLeaveConf()
FUNCTION USAGE
AdeptSysChatLeaveConf(LineNumber)
ARGUMENTS
LineNumber:
Node Number passed to REXX routine from Adept as first parameter.
RETURNED VALUE
Returns 1 every time.
DESCRIPTION
If the user is in a conference it will remove the user from the
conference.
NOTES
EXAMPLE
This example will notify other users and then leave the current
conference.
if(Command == '/Q' | Command == '/E') then do
SendString = '{FE[{FG' || UserNode || '{F8-{FB' || UserName || '{FE] {FC{ZZ' || 'Leaving...'
call AdeptSysChatPubMsg line, SendString
call AdeptSysChatLeaveConf line
exit
end
RELATED FUNCTIONS
AdeptSysChatJoinConf()
---------------------------------------------------------------------------
AdeptSysChatMessageWaiting()
FUNCTION USAGE
value = AdeptSysChatMessageWaiting(LineNumber)
ARGUMENTS
LineNumber:
Node Number passed to REXX routine from Adept as first parameter.
RETURNED VALUE
0 - Syntax Error
1 - There is a chat message waiting
2 - Error User Not Connected
3 - Error Server is Down
DESCRIPTION
Checks to see if the User on LineNumber has a chat message waiting.
NOTES
EXAMPLE
do while(AdeptSysChatMsgWaiting(line) == 1)
RetC = AdeptSysChatGetMsg(line)
.
.
/* Deal misc different pkttypes etc. */
.
.
end
RELATED FUNCTIONS
---------------------------------------------------------------------------
AdeptSysChatMsg()
FUNCTION USAGE
Call AdeptSysChatMsg LineNumber, Text
ARGUMENTS
LineNumber:
Node Number passed to REXX routine from Adept as first parameter.
Text:
Message to send to user.
RETURNED VALUE
DESCRIPTION
Sends a chat message to a user.
NOTES
You format how the text is to be displayed to the remote user.
Please use the {COLOR metas or ascii users will get ansi if you
put ANSI escape characters etc in the text.
This can be used for annoucements such as User so and so has logged
on via node such and such. Be creative.
EXAMPLE
RELATED FUNCTIONS
---------------------------------------------------------------------------
AdeptSysChatPrivMsg()
FUNCTION USAGE
Call AdeptSysChatPrivMsg LineNumber, Node, MessageText
or
value = AdeptSysChatPrivMsg(LineNumber, Node, MessageText)
ARGUMENTS
LineNumber:
Node Number passed to REXX routine from Adept as first parameter.
Node:
Node Number to send the message to.
MessageText:
Message Text.
RETURNED VALUE
0 - Message wasn't sucessfully sent
1 - Message was sent
DESCRIPTION
Sends a private chat message to a specified node number.
NOTES
If the user is not on a particular node the message will go into
limbo.
EXAMPLE
This example will send a private message contained in MsgText to the
user on node NodeTo.
SendString = '{FE[{FG' || UserNode || '{F8-{FB' || UserName || '{FD, Pvt Msg{FE] {FC{ZZ' || MsgText
call AdeptSysChatPrivMsg line, NodeTo, SendString
RELATED FUNCTIONS
AdeptSysChatPubMsg()
---------------------------------------------------------------------------
AdeptSysChatPubMsg()
FUNCTION USAGE
call AdeptSysChatPubMsg LineNumber, MessageText
value = AdeptSysChatPubMsg(LineNumber, MessageText)
ARGUMENTS
LineNumber:
Node Number passed to REXX routine from Adept as first parameter.
MessageText:
Message Text.
RETURNED VALUE
0 - Message wasn't sucessfully sent misc error
1 - Message was sent
DESCRIPTION
Send a public message in the current conference.
NOTES
The user must be a in a conference for others to see the message or
it will just go into limbo.
EXAMPLE
The following example will announce to the current conference that you
have entered.
SendString = '{FE[{FG' || UserNode || '{F8-{FB' || UserName || '{FE] {FC{ZZ' || 'Entering...'
AdeptSysChatPubMsg(line, SendString)
RELATED FUNCTIONS
AdeptSysChatPrivMsg()
---------------------------------------------------------------------------
AdeptSysChatReconnectUser()
FUNCTION USAGE
value = AdeptSysChatReconnectUser(LineNumber)
ARGUMENTS
LineNumber:
Node Number passed to REXX routine from Adept as first parameter.
RETURNED VALUE
0 - Syntax error
1 - User connected to server
2 - Failed to reconnect user
3 - Sever not available
DESCRIPTION
Reconnects a user to the chatserver.
NOTES
AdeptSysChatReconnectUser() should only be used to reconnect a
user to the chatserver after it has gone down and the user was
chatting in a conference.
EXAMPLE
The following example will attempt to reconnect to the chatserver if
it detects that the chatserver has gone down. If the reconnection
fails, It will exit the conference then exit the script.
if(RetC == IRC_CHATDOWN) then do
RetC = AdeptSysChatReconnectUser(line)
if(RetC \= 1) then do
call AdeptSysChatLeaveConf line
exit
end
end
RELATED FUNCTIONS
AdeptSysChatConnectUser()
AdeptSysChatUserConnected()
---------------------------------------------------------------------------
AdeptSysChatUserConnected()
FUNCTION USAGE
value = AdeptSysChatUserConnected(LineNumber)
ARGUMENTS
LineNumber:
Node Number passed to REXX routine from Adept as first parameter.
RETURNED VALUE
0 - Syntax Error
1 - User connected
2 - User not connected
3 - Server down, obviosly the user is not connected.
DESCRIPTION
Checks to make sure the user is properly connected to the chat
server.
NOTES
EXAMPLE
This example will try to reconnect to the chatserver. If it fails it
will exit the script.
call AdeptSysChatReconnectUser line
RetC = AdeptSysChatUserConnected(line)
if(RetC \= 1) then do
call AdeptPrint line, "\rCould not reconnect to chat server, exiting...\r\n"
exit
end
else do
call AdeptPrint line, "\rChat server reconnected, you may continue to chat.\r\n"
end
RELATED FUNCTIONS
AdeptSysChatConnectUser()
AdeptSysChatReconnectUser()
---------------------------------------------------------------------------
AdeptSysCheckForServer()
FUNCTION USAGE
value = AdeptSysCheckForServer(LineNumber)
ARGUMENTS
LineNumber:
Node Number passed to REXX routine from Adept as first parameter.
RETURNED VALUE
0 - Syntax error
1 - Server not available
2 - Server available
DESCRIPTION
Checks to make sure the chat server is available.
NOTES
EXAMPLE
RELATED FUNCTIONS
---------------------------------------------------------------------------
*** End Of AdeptXBBS AdeptRexx v1.08x ChatServer Functions. ***
---------------------------------------------------------------------------